package com.itic.mall.system.inter.pay.userlog.service;


import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.itic.appbase.framework.type.*;
import com.itic.mall.mobile.users.info.UserPreincomeVo;
import com.itic.mall.system.inter.orders.item.persistence.model.OrdersItem;
import com.itic.mall.system.inter.pay.userlog.persistence.model.PayUserlog;
import com.itic.mall.system.inter.pay.userlog.persistence.model.PayUserlogExample;
import com.itic.mall.system.inter.users.usersmall.persistence.model.UsersMall;



public interface PayUserlogService{

    

    /**
	 * 获取用户支付信息返回数据
	 * @param payList
	 * @param userId
	 * @return
	 */
	public List<UserPreincomeVo> getPreincomeVo(List<PayUserlog> payList, String userId) ;
    /**
	 * 根据查询条件获取用户支付日志表
	 * @param ordersItem
	 * @param userId
	 * @param preType
	 * @param type
	 * @param users
	 * @param PayUserlog
	 * @param request
	 * @return
	 */
	public PayUserlogExample getPayUserlog(String jiesuan, List<String> orderNos, OrdersItem ordersItem, String userId, String preType, String type, UsersMall users, PayUserlog PayUserlog, HttpServletRequest request);
	/**
	 * 根据订单项条件获取相关订单号数据
	 * @param payList
	 * @param ordersItem
	 * @return
	 */
	public List<String> getPayUserlogByOrdersItem(List<PayUserlog> payList,OrdersItem ordersItem);
	
    public List<PayUserlog> findPayUserLogBycondition(PayUserlogExample example, String userId, PreType type, String orderNo, String startTime, String endTime) ;
    /**
	 * 店铺订单用户支付记录ids
	 * 
	 * @param userId
	 * @return
	 */
    public List<String> getPayUserlogIds(String userId);
    /***
     * 查找对应的支付记录
     * @param payUserlog
     * @return
     */
    public PayUserlog getPayType(PayUserlog payUserlog);
    
    public PayUserlog getPayUserlog(String orderNo,String skuId,String preIncomeType);
    /**
	 * 根据用户id获取累计预估或者实际收益
	 * 
	 * @param userId
	 * @param preTytpe
	 * @return
	 */
	public int getPreOrActualNum(String userId, String preTytpe) ;
	/**
	 * 查看用户最后一次提现
	 * */
	public List<PayUserlog> getWithDrawals(String userId) ;
	
	public  PayUserlog getTheLastPayUserLog(String userId) ;
	
	/**
	 * 获取提现总额
	 * @param userId
	 * @return
	 */
	public double getTotalAmount(String userId) ;
	
	public PayUserlog addWithDrawals(double totalWithDrawals,double balance,double amount,double fee,String userId) ;
	
	/***
	 * 
	 * @param usersMall 用户
	 * @param commission 佣金
	 * @param taxCompany 公司的扣税
	 * @param orderNo 订单号
	 * @param preType 收益类型 
	 * @param channel 渠道
	 * @param skuId 商品规格Id
	 * @param operateType 预计操作
	 * @return
	 */
	public String addUserTeamPreProfit(UsersMall usersMall,String commission,TaxCompany taxCompany,String orderNo,PreType preType,PreIncomeChannel channel,String skuId,OperateType operateType,PreIncomeType preIncomeType,Integer count) ;
	
	public Double addUserPreProfit(UsersMall usersMall,String commission,TaxCompany taxCompany,String orderNo,PreType preType,PreIncomeType preIncomeType,PreIncomeChannel channel,String skuId,TeamLevel teamLevel,UserType userType,OperateType operateType,boolean isTaxPercent,Integer count) ;
	
	public Double savePreAmountByTax(UsersMall usersMall,String commission,TaxCompany taxCompany,String orderNo,PreType preType,PreIncomeType preIncomeType,PreIncomeChannel channel,String skuId,TeamLevel level,UserType userType,OperateType operateType,boolean isTaxPercent,Integer count) ;
	
	public Double calPreAmountByTax(UsersMall usersMall,String commission,TaxCompany taxCompany ,TeamLevel level,UserType userType,boolean isTaxPercent,Integer count) ;
	
	public String addProfitAmount(String userId, String orderNo, PreType preType, double amount, PreIncomeType preIncomeType, PreIncomeChannel preIncomeChannel, String skuId, OperateType operateType) ;
	
	public String addPayAmount(String userId, FinanceType financeType, Double amount, PayType payType, String orderNo, String payNo, Date payTime) ;
	
	public List<PayUserlog> getPreAmountByOrderNoAndSkuIdAndType(String orderNo,String skuId,PreType preType) ;
	

	
	public double calRemainCommission(UsersMall yunUser,String commission,TaxCompany taxCompany,int count) ;
	
	
}